Views [dbo].[vSoaGroupSummary]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Created2:19:22 AM Thursday, August 25, 2011
Last Modified1:49:29 PM Thursday, September 22, 2011
Columns
Name
GroupId
ParentEntityTypeName
ParentEntityId
GroupClassId
Name
Description
IsSimpleGroup
IsMemberGroup
IsPrimaryGroup
SQL Script


CREATE VIEW [dbo].[vSoaGroupSummary]
AS
    SELECT  [GroupId],
            [ParentEntityTypeName],
            [ParentEntityId],
            [GroupClassId],
            [Name],
            NULL AS [Description],
         -- can't use Product.DESCRIPTION in an indexed view
            CAST(0 AS BIT) AS [IsSimpleGroup],
            CAST(0 AS BIT) AS [IsMemberGroup],
            CAST(0 AS BIT) AS [IsPrimaryGroup]
      FROM  [dbo].[vSoaGroupSummaryProduct]
    UNION ALL
    SELECT  [GroupId],
            [ParentEntityTypeName],
            [ParentEntityId],
            [GroupClassId],
            [Name],
            NULL AS [Description],
         -- can't used Meet_Mater.DESCRIPTION in an indexed view. can go get it here if needed
            CAST(1 AS BIT) AS [IsSimpleGroup],
            CAST(0 AS BIT) AS [IsMemberGroup],
            CAST(0 AS BIT) AS [IsPrimaryGroup]
      FROM  [dbo].[vSoaGroupSummaryMeeting]
    UNION ALL
    SELECT  [GroupId],
            [ParentEntityTypeName],
            [ParentEntityId],
            [GroupClassId],
            [Name],
            [Description],
            CAST(1 AS BIT) AS [IsSimpleGroup],
            [IsMemberGroup],
            CAST(1 AS BIT) AS [IsPrimaryGroup]
      FROM  [dbo].[vSoaGroupSummaryMT]
    UNION ALL
    SELECT  [GroupId],
            [ParentEntityTypeName],
            [ParentEntityId],
            [GroupClassId],
            [Name],
            CAST('Relationships' AS VARCHAR(6000)) AS [Description],
            CAST(0 AS BIT) AS [IsSimpleGroup],
            CAST(0 AS BIT) AS [IsMemberGroup],
            CAST(0 AS BIT) AS [IsPrimaryGroup]
      FROM  [dbo].[vSoaGroupSummaryRelationship]
    UNION ALL
    SELECT  [GroupId],
            [ParentEntityTypeName],
            [ParentEntityId],
            [GroupClassId],
            [Name],
            CAST('Organizational Relationship' AS VARCHAR(6000)) AS [Description],
            CAST(0 AS BIT) AS [IsSimpleGroup],
            CAST(0 AS BIT) AS [IsMemberGroup],
            CAST(0 AS BIT) AS [IsPrimaryGroup]
      FROM  [dbo].[vSoaGroupSummaryOrganization]

GO
Uses